package de.dubiel.plung.client.canvas;

import com.google.gwt.canvas.dom.client.Context2d;

public class Circle implements Drawable {
    private int width;
    private String fillColor;
    private String strokeColor;
    private Vector centerPoint;
    private double radius;

    public int getWidth() {
        return width;
    }

    public void setWidth(int width) {
        this.width = width;
    }

    public String getFillColor() {
        return fillColor;
    }

    public void setFillColor(String fillColor) {
        this.fillColor = fillColor;
    }

    public String getStrokeColor() {
        return strokeColor;
    }

    public void setStrokeColor(String strokeColor) {
        this.strokeColor = strokeColor;
    }

    public Vector getCenterPoint() {
        return centerPoint;
    }

    public void setCenterPoint(Vector centerPoint) {
        this.centerPoint = centerPoint;
    }

    public double getRadius() {
        return radius;
    }

    public void setRadius(double radius) {
        this.radius = radius;
    }

    @Override
    public void draw(Context2d context) {
        context.beginPath();
        context.setLineWidth(width);
        context.setStrokeStyle(strokeColor);
        context.setFillStyle(fillColor);
        context.arc(centerPoint.getX(), centerPoint.getY(), radius, 0, Math.PI * 2);
        context.closePath();
        context.fill();
    }
}